<template>
  <el-date-picker type="date"
                  :placeholder="propertyForm.placeholder?propertyForm.placeholder:''"
                  v-model="propertyForm.valueText"
                  :picker-options="pickerOptions1"
                  format="yyyy-MM-dd"
                  size="small"
                  class="mr-10"
                  value-format="yyyy-MM-dd"></el-date-picker>
</template>

<script>

export default {
  name: 'DataPickerModle',
  props: ['property'],
  watch: {
    property: {
      immediate: true,
      handler(val) {
        // console.log('val,',val)
        this.propertyForm = this.getJson(val)
      }
    },
    'propertyForm.valueText': {
      handler() {
        // console.log('更新啦input：', val)
        this.$emit('updateVal', {'input':this.propertyForm})
      },
      deep: true
    },
  },
  data () {
    return {
      propertyForm:{},
      pickerOptions1: {
        disabledDate (time) {
          return time.getTime() > Date.now()//  - 8.64e7
        }
      }
    }
  },
  created () {
  },
  methods: {
    getJson(item){
      return JSON.parse(JSON.stringify(item))
    }
  },
  mounted () {
    // this.$emit('update:property', this.propertyForm)
  }
}
</script>
